package org.jeecg.modules.demo.zyExam.zypaperjudgequestion.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.demo.zyExam.zypaperjudgequestion.entity.ZyPaperJudgeQuestion;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

/**
 * @Description: 题库判断题
 * @Author: jeecg-boot
 * @Date:   2025-05-23
 * @Version: V1.0
 */
public interface ZyPaperJudgeQuestionMapper extends BaseMapper<ZyPaperJudgeQuestion> {

    @Select("select id from zy_paper_judge_question  where subject =#{subject}  order by rand() desc limit #{judgeNumber}")
    List<String> findBySubject(@Param("subject") String subject, @Param("judgeNumber") Integer judgeNumber);

    @Select("select * from zy_paper_judge_question where id in (select question_code from zy_paper_manage where question_type = 3 and paper_code = #{paperCode})")
    List<ZyPaperJudgeQuestion> findByIdAndType(@Param("paperCode") String paperCode);
}
